<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta content="always" name="referrer">
<meta charset="utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!-- 移动端必须的设置 -->
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<!-- 禁用电话号码检测功能，禁止对数字随便可以拨号 -->
<meta name="format-detection" content="telephone=no">
<!-- 禁用E-mail检测功能 -->
<meta name="format-detection" content="email=no">
<!-- 禁用地址检测功能，禁止跳转到地图 -->
<meta name="format-detection" content="address=no">
<!-- 在苹果设备上以全屏方式打开本网页 -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- 设置在苹果设备上状态的颜色，默认白色，要设置成什么颜色以Web颜色的风格而定 -->
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<title>途狗收油</title>
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/base64.js"></script>
<script type="text/javascript" src="../js/layui/layui.js "></script>
<script type="text/javascript" src="../js/recycle/addresslist.js?v=1.1"></script>
<script type="text/javascript" src="../vendor/resize.js"></script>
 <script type="text/javascript" src="../js/jquery.citys.js"></script> 
<link rel="stylesheet" href="../js/layui/css/layui.css" />
<link rel="stylesheet"
	href="../vendor/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="../vendor/iconfont/iconfont.css" />
<link rel="stylesheet" href="../css/basestyle.css" />
<link rel="stylesheet" href="../css/address.css" />
<link rel="shortcut icon" href="../public/image/favicon.png">
<link rel="stylesheet" type="text/css"
	href="../public/style/cssreset-min.css">
<style type="text/css">
.tangram-suggestion-main {
	z-index: 50;
}

.citys {
	margin-bottom: 10px;
}

.citys p {
	line-height: 28px;
}

.warning {
	color: #c00;
}

.main a {
	margin-right: 8px;
	color: #369;
}
</style>
</head>
<body>
	<%@ include file="../basejsp.jsp"%>
	<div class="header">
		<div class="header-top">
			<a onClick="javascript :history.go(-1);"><i
				class="fa fa-angle-left"></i></a> <span>添加地址</span> <!-- <i
				class="icon iconfont icon-gengduo-hengxiang"></i> -->
		</div>
	</div>
	<div class="main">
		<ul class="content">
		</ul>
		<div class="bottom">
			<a onclick="addaddresspopup()">提交</a>
		</div>
	</div>

	<div id="popupwindows" class="popupwindows">
	  	<div id="demo3" class="citys">
                <p>
                    <select name="province"></select>
                    <select name="city"></select>
                    <select name="area"></select>
                    <select name="town"></select>
                </p>
            </div>
		<input type="text" name="title" autocomplete="off" id="baiduaddress"
			class="layui-input">
		<button class="layui-btn layui-btn-normal"
			style="width: 100%; margin-top: 64px;"
			onclick="insertHistoryAddress()">确认提交</button>
	</div>
	<script type="text/javascript">
		$(function() {
			$("input[data-shebao=suibianyige]").on("click", function() {
				$("input[data-shebao=suibianyige]").prop("checked", false);
				$(this).prop("checked", true);
				//$(this).parent().find(".mo").css("color","#ff5500");
			});
			var $town = $('#demo3 select[name="town"]');
    		var townFormat = function(info){
    			$town.hide().empty();
    			if(info['code']%1e4&&info['code']<7e5){	//是否为“区”且不是港澳台地区
    				$.ajax({
    					url:'http://passer-by.com/data_location/town/'+info['code']+'.json',
    					dataType:'json',
    					success:function(town){
    						$town.show();
    						for(i in town){
    								$town.append('<option value="'+i+'">'+town[i]+'</option>');
    						}
    					}
    				});
    			}
    		};
            $('#demo3').citys({
    			province:'重庆',
    			/*city:'厦门',
    			area:'思明',*/
    			onChange:function(info){
    				townFormat(info);
    			}
    		},function(api){
    			var info = api.getInfo();
    			townFormat(info);
    		});
		})
	</script>
</body>
</html>